A panorama image is a 360-degree image by stitching images photographed by a fish-eye lens using professional drawing tools of panorama image (such as panatools). The fish-eye lens is a wide-angle lens. As a usual definition, a lens with a view angle up to 180-degree is called as a fish-eye lens. The existing images photographed by a fish-eye lens usually become distorted, therefore, a method and device for rectifying an image photographed by a fish-eye lens is needed to rectify an image photographed by a fish-eye lens, so as to form an image with higher precision and further form a panorama image with higher precision.
FIG. 1 shows an imaging diagram of a fish-eye lens. As shown in FIG. 1, the incident light finally images on the film after refraction through the lens, the light through the optical axis directly images on the center of the image without refraction. The incident light with an incident angle θ will image on the film along the dotted line if not refracted, with a distance rRef to the center of the film: rRef=f×tan(θ), wherein f is a distance between the focus of the lens and the film. In fact, the incident light with an incident angle θ will be refracted through lens, the refracted light will be mapped onto the film with a distance rReal to the center of the film, a function relationship between rReal and θ as rReal=F(θ), and the function is called as a mapping curve of the lens. The mapping parameters of the lens can be obtained from the manufacturer.
Table 1 shows mapping parameters of a fish-eye lens from the manufacturer.
TABLE 1Lens Mapping ParametersθrRealrRefrReal fittingErrors (%). . .. . .. . .. . .. . .83.500000001.291736679.290668581.28731667−0.34217499984.000000001.2965173410.07131611.292040736−0.34527914684.500000001.3012476710.993337211.29671462−0.3483618185.000000001.3059274812.099144431.301338125−0.3514249585.500000001.3105565813.450000251.305911055−0.35446962186.000000001.3151348315.137798321.310433216−0.35750053186.500000001.3196620417.306942931.314904415−0.36051843587.000000001.3241380520.198107811.319324461−0.3635262287.500000001.3285627324.244505631.323693164−0.36652886888.000000001.3329359130.312561591.328010336−0.36952819488.500000001.3372574440.423934421.33227579−0.37252736789.000000001.3415272160.643600031.336489341−0.37553237689.500000001.34574506121.29643781.340650805−0.3785453290.500000001.35402452−121.29643781.348816745−0.38461452291.000000001.35808589−60.643600031.352820861−0.38768011991.500000001.36209488−40.423934411.35677217−0.39077380192.000000001.36605137−30.312561591.360670496−0.39389982892.500000001.36995528−24.244505621.364515664−0.39706521993.000000001.3738065−20.198107811.368307501−0.40027463893.500000001.37760495−17.306942921.372045835−0.40353476894.000000001.38135055−15.137798311.375730496−0.4068521294.500000001.38504322−13.450000241.379361315−0.41023304295.000000001.3886829−12.099144431.382938125−0.413685154. . .. . .. . .. . .. . .
Table 1 only shows the mapping parameters for some incident angles, while a complete table of the mapping parameter has a range of
      [          0      ,              fov        2              ]    ,including the mapping parameters every 0.5-degree incident angle; herein, fov is the lens field angle. Drawing scatter plot graphs according to the mapping parameter table, and then a fitting curve is obtained by linear regression. The fitting curve according to Table 1 is:rReal=F(θ)=1.0×10−9θ4−6.0×10−7θ3+8.5×10−6θ2+0.0183θ+0.0007  (Formula 1)by comparing the result calculated from the fitting curve with the real result, thus the Error:Error=(rReal fitting−rReal)/rReal×100%  (Formula 2)The Error of the fitting curve is less than 0.5%. Of course, the fitting curve of less error can be obtained by increasing the order of the polynomial.
Therefore, a method and device for rectifying an image photographed by a fish-eye lens is needed in the field for rectifying the images photographed by a fish-eye lens with an viewing angle over 180 degrees and with given parameters, so as to form an image with higher precision, and form a panorama image with higher precision by further stitching.